{% extends 'base.html' %}

{% block head %}
    <link rel="stylesheet" href="{{ url_for('static',filename='css/detail.css') }}">
{% endblock %}

{% block title %}详情{% endblock %}

{% block main %}
    {% if a==1 %}
        <script language="javascript"> //JavaScript脚本标注
        alert("上传完成");//在页面上弹出上联
        </script>
    {% endif %}   
    <h3 class="page-title">{{ question.title }}</h3>
    <p class="question-info">
        <span>{{ question.author.username }}</span>
        <span>创建时间：{{ question.create_time }}</span>
    </p>
    <p class="url-title" style="text-align: center;">网址：<a href="{{question.url}}" target="_blank" style="color: #0000ff">{{ question.url }}</a></p>
    

    <div>
    <hr>
    <p style="font-size: 16px; margin-left: 160px;">项目需求：</p>
    <div style="margin-left: 170px;margin-right: 30px;width: 500px;background: #f0f0f0;">
    <p class="question-content" style="margin:10px; ">{{ question.content }}</p>
    </div>
    <hr>


    <div class="bigbox" style="margin-left:150px ">

        <form action="{{ url_for('add_answer') }}" method="post">
            <p class="url-title" style="float: left; margin-left: 10px;"><a href="{{url_for('input',question_id=question.id)}}" style="font-size: 16px;font-weight: 900;">上传附件</a></p>
            <div class="post_data" style="float: left; margin-left: 300px;"> 
                    <input type="hidden" name="question_id" value="{{ question.id }}">
                    <span class="label label-default" style="float: left;margin-left:10px;  height: 25px;background: green;line-height: 25px;">状态</span>
                    <select name="zhuangtai" style="height: 25px; margin-left: 5px">
                            <option value="null">无状态</option>
                            <option value="sleep">休眠</option>
                            <option value="pending">等待</option>
                            <option value="running">正在运行</option>
                    </select>  
            </div> 
            <input type="hidden" name="question_id" value="{{ question.id }}">
            <div class="form-container" style="margin-right:0px">
                <div class="form-group">
                    <input type="text" placeholder="备注" name="content" class="form-control">
                </div>
                <div class="form-group">
                    <button class="btn btn-primary">提交</button>
                </div>
            </div>
        </form>
    </div>
    <div style="height: 5px;background: #e0e0e0;width: 100%"></div>
    <div style="margin-left: 50px">
    <ul class="comment-group" style="list-style: none;margin: 0;padding: 0;"> 
        <li style="">
            <p style="font-weight: 900;font-size: 16px; ">备注：</p>
            <p class="comment-content">{{ question.beizhu }}</p>
        </li>
    </ul>
    
    
    {% if content %}
        <p>附件:</p>
        {% for li in question.file %}
            <li style="float: left;margin-right: 10px; ">{{ li.name }}</li>
            <a href="{{url_for('download', filename=li.content,filedata=question.filename)}}">download</a><br>
        {% endfor %}
    {% endif %}   

    </div>
{% endblock %}